<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">
       $(function(){

       		$('#txt01').keyup(function(){

       			var val = $(this).val();

       			$.ajax({

					url: 'https://sug.so.360.cn/suggest?',
					type: 'get',
					dataType: 'jsonp',
					data: {word: val}
					})
					.done(function(data) {

						$('.list').empty();

						for(var i=0;i<data.s.length;i++){
							var $li = $('<li>'+ data.s[i] +'</li>');

							$li.prependTo('.list');
						}

					})
					.fail(function() {
						console.log("error");
					})

       			})

       		


       })


		

	</script>
</head>
<body>
	<input type="text" name="" id="txt01">
	<ul class="list"></ul>
</body>
</html>